﻿using System;
using BIS.Portal.Core.Base;
using BIS.Portal.Core.Global;

namespace BIS.Portal.Modules.CMS
{
    public partial class CmsMediaListControl_Settings : ControlSettingBase
    {
        #region Load data properties
        public string SLMediaList
        {
            get { return GetControlSetting<string>(ModuleSettingNames.CmsMediaList.txtSLMediaList, PortalContext.LanguageAlias); }
        }
        public bool HienThiTieuDeTin
        {
            get { return GetControlSetting<bool>(ModuleSettingNames.CmsMediaList.ddlMediaTieuDe, PortalContext.LanguageAlias); }
        }
        public bool HienThiMoTaTin
        {
            get { return GetControlSetting<bool>(ModuleSettingNames.CmsMediaList.ddlMediaMoTa, PortalContext.LanguageAlias); }
        }
        public bool HienThiLinkCtTin
        {
            get { return GetControlSetting<bool>(ModuleSettingNames.CmsMediaList.ddlMediaLinkCt, PortalContext.LanguageAlias); }
        }
        public string SLPopupAnh
        {
            get { return GetControlSetting<string>(ModuleSettingNames.CmsMediaList.txtSLAnhPopup, PortalContext.LanguageAlias); }
        }
        public string SLPopupVideo
        {
            get { return GetControlSetting<string>(ModuleSettingNames.CmsMediaList.txtSLVideoPopup, PortalContext.LanguageAlias); }
        }
        public string SLPopupFile
        {
            get { return GetControlSetting<string>(ModuleSettingNames.CmsMediaList.txtSLFilePopup, PortalContext.LanguageAlias); }
        }
        #endregion
        protected void Page_Load(object sender, EventArgs e)
        {
            loaddata();
        }
        private void loaddata()
        {
            txtSLMediaList.Text = SLMediaList;
            ddlMediaTieuDe.SelectedIndex = HienThiTieuDeTin ? 0 : 1;
            ddlMediaMoTa.SelectedIndex = HienThiMoTaTin? 0 : 1;
            ddlMediaLinkCt.SelectedIndex = HienThiLinkCtTin ? 0 : 1;
            txtSLAnhPopup.Text = SLPopupAnh;
            txtSLVideoPopup.Text = SLPopupVideo;
            txtSLFilePopup.Text = SLPopupFile;
        }
        public override void SaveSettings(System.Collections.Generic.Dictionary<string, string> settings)
        {
            SetControlSettingForAllLanguages(txtSLMediaList.ID, ModuleSettingNames.CmsMediaList.txtSLMediaList, settings);
            SetControlSettingForAllLanguages(ddlMediaTieuDe.ID, ModuleSettingNames.CmsMediaList.ddlMediaTieuDe, settings);
            SetControlSettingForAllLanguages(ddlMediaMoTa.ID, ModuleSettingNames.CmsMediaList.ddlMediaMoTa, settings);
            SetControlSettingForAllLanguages(ddlMediaLinkCt.ID, ModuleSettingNames.CmsMediaList.ddlMediaLinkCt, settings);
            SetControlSettingForAllLanguages(txtSLAnhPopup.ID, ModuleSettingNames.CmsMediaList.txtSLAnhPopup, settings);
            SetControlSettingForAllLanguages(txtSLVideoPopup.ID, ModuleSettingNames.CmsMediaList.txtSLVideoPopup, settings);
            SetControlSettingForAllLanguages(txtSLFilePopup.ID, ModuleSettingNames.CmsMediaList.txtSLFilePopup, settings);
        }


    }
}